import React from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import { Card, Alert, Typography } from 'antd';
import { useIntl, FormattedMessage } from 'umi';
import styles from './Welcome.less';
import { request } from 'umi';

const CodePreview: React.FC = ({ children }) => (
  <pre className={styles.pre}>
    <code>
      <Typography.Text copyable>{children}</Typography.Text>
    </code>
  </pre>
);

const Welcome: React.FC = () => {
  const intl = useIntl();
  const getUserName = async () => {
    request(`/api/currentUser`, {
      method: 'GET',
    }).then((val) => console.log(val.data.access));
  };
  getUserName();

  return (
    <PageContainer>
      <div style={{ textAlign: 'center' }}>
        <Typography.Title>欢迎来到在线心理咨询系统</Typography.Title>
      </div>
    </PageContainer>
  );
};

export default Welcome;
